package com.sinog.front.feign.biz;

import com.sinog.core.model.UserDTO;
import com.sinog.core.utilbean.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;

/**
 * @desc 服刑信息
 * @author -
 * @date 2020-02-05-16:22
 */
@FeignClient("sinog2c-biz")
public interface SentenceService {

    /**
     * 获取所有的犯罪类型
     * @param codeType codeType
     * @param pCodeId pCodeId
     * @return List<Map<String,Object>>
     */
    @GetMapping("/azbj/inmates/syscode")
    List<Map<String,Object>> getCodeName(@RequestParam("codeType") String codeType, @RequestParam("pCodeId")String pCodeId);

    /**
     * 预安置人员信息录入 - 服刑信息tab页 -
     * 犯罪类型下拉 codetype=2_12
     * 现刑期下拉 codetype=1_9
     * 职业技能下拉 codetype=4_1
     * @param codeIds codeIds
     * @return Result
     */
    @PostMapping ("/azbj/inmates/sentence/syscode")
    Result getCodeName(@RequestParam("codeIds") String codeIds);

    /**
     * 预安置人员信息录入 - 保存/更新 服刑信息
     * @param data data
     * @param user user
     * @return Result
     */
    @RequestMapping("/azbj/sentence/saveinfo")
    Result saveSentenceInfo(@RequestParam(required = false, defaultValue = "-1") String data,@RequestBody UserDTO user);

    /**
     * 预安置人员信息录入 - 保存/更新 服刑信息excel
     * @param data data
     * @param user user
     * @return Result
     */
    @RequestMapping("/azbj/sentence/saveinfoexcel")
    Result saveSentenceInfoExcel(
            @RequestParam(required = false, defaultValue = "-1") String data,@RequestBody UserDTO user);

    /**
     * 根据犯罪编号查询罪犯服刑信息
     * @param prinum prinum
     * @return String
     */
    @PostMapping("/azbj/seninfo/edit")
    String getSenInfoById(@RequestParam(required = false, defaultValue = "-1") String prinum);

    /**
     * 根据犯罪编号查询罪犯服刑信息excel
     * @param prinum prinum
     * @return String
     */
    @PostMapping("/azbj/seninfo/editexcel")
    String getSenInfoByIdExcel(@RequestParam(required = false, defaultValue = "-1") String prinum);

    /**
     * 预安置人员信息录入 - 服刑信息页面 - 罪名下拉列表
     * @param codeType codeType
     * @param codeId codeId
     * @param queryKey queryKey
     * @param pageIndex pageIndex
     * @param pageSize pageSize
     * @return String
     */
    @RequestMapping("/azbj/yazgl/inmates/zuiming/list")
    String getZuiMingList(
            @RequestParam("codeType") String codeType,
            @RequestParam("codeId") String codeId,
            @RequestParam("queryKey") String queryKey,
            @RequestParam("pageIndex") Integer pageIndex,@RequestParam("pageSize") Integer pageSize);

    /**
     * 来判断这个服刑人员有没有刑期起止日
     * @param priNum priNum
     * @return String
     */
    @GetMapping("/azbj/inmates/selectHasDate")
    String selectHasDate(@RequestParam("priNum") String priNum);

    /**
     * 根据犯罪编号查询该罪犯基本信息和服刑信息必填项是不是全部填写完成
     * @param prinum prinum
     * @return Integer
     */
    @PostMapping("/azbj/seninfo/isall")
    Integer getIsAll(@RequestParam(required = false, defaultValue = "-1") String prinum);
}